//表单验证
var school_check_flag = false;
var name_check_flag = false;
var number_check_flag = false;

function isName(name){
    var reg=/^[\u0391-\uFFE5]+$/;
    if(name != "" && !reg.test(name)){  //名字不为空 且 检验失败
        document.getElementById("check-name-box").style.display="block";
        document.getElementById("check-name-box").className += "shake";
        name_check_flag = false;  //表示名字检验失败
        return false;
    }
    else if(name ==""){ //名字不能提交空串
        document.getElementById("check-name-box").style.display="block";
        document.getElementById("check-name-box").className += "shake";
        name_check_flag = false;
        return false;
    }
    else{ 
        document.getElementById("check-name-box").style.display="none";
        document.getElementById("check-name-box").className = "animated ";
        name_check_flag = true;  //校验成功
        return true;
    }
}

function isSchool(name){
    var reg=/^[\u0391-\uFFE5]+$/;
    if(name != "" && !reg.test(name)){
        document.getElementById("check-school-box").style.display="block";
        document.getElementById("check-school-box").className += "shake";
        school_check_flag = false;
        return false;
    }
    else if(name == ""){
        document.getElementById("check-school-box").style.display="block";
        document.getElementById("check-school-box").className += "shake";
        school_check_flag = false;

        return false;
    }
    else{
        document.getElementById("check-school-box").style.display="none";
        document.getElementById("check-school-box").className = "animated ";
        school_check_flag = true;
        return true;
    }
}

function isNumber(num){
    var re = new RegExp("^[0-9]*[1-9][0-9]*$");
    if(num !=="" && !re.test(num)){
        document.getElementById("number-check-box").style.display = "block";
        document.getElementById("number-check-box").className += "shake";
        number_check_flag = false;
        return false;
    }
    else if(num === ""){
        document.getElementById("number-check-box").style.display = "block";
        document.getElementById("number-check-box").className += "shake";
        number_check_flag = false;

        return false;
    }
    else{
        document.getElementById("number-check-box").style.display = "none";
        document.getElementById("number-check-box").className = "animated ";
        number_check_flag = true;

        return true;
    }
}